<template>
<div>  
  <h2 class="demo">你好我是welcome组件！</h2> <br>
  <button @click="sendData($event)">点击发送数据</button>
</div>
</template>

<script>
  export default {
    props:['receiveData'],
    methods:{
      sendData(event){
        console.log(event.target.innerText);
        //通知App组件在data中添加数据
        this.receiveData('9527');
      }
    }
  }
</script>

<style>
    .demo{
        background-color: aquamarine;
    }
</style>